package com.example.mes;

import com.example.mes.schedule.DataSchedule;
import com.example.mes.schedule.testAsync;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import java.util.concurrent.ThreadPoolExecutor;

@MapperScan(basePackages = {"com.example.mes.mapper"})
//@EnableAsync//开启异步调用
@SpringBootApplication
public class MesApplication {
    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext context = SpringApplication.run(MesApplication.class, args);
//        testAsync dataSchedule = (testAsync)context.getBean("testAsync");
//        dataSchedule.test2();
    }


}
@Configuration
class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

}